/****

    activequant - activestocks.eu

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

	
	contact  : contact@activestocks.eu
    homepage : http://www.activestocks.eu

 ****/
package org.activequant.calendar;

import java.util.TimeZone;

import org.activequant.core.types.Exchange;

/**
 * Exchange calendar settings for Eurex exchange (ECAG). <br/>
 * ECAGCalendarSettings implements IExchangeCalendarSettings. Holds the following associated variables:
 * <ul>
 * <li>eCAGCalendarSettings(ECAGCalendarSettings)</li>
 * <li>EXCHANGE(Exchange) (Exchange.ECAG)</li>
 * <li>TIMEZONE(TimeZone) (TimeZone.getTimeZone("Europe/Berlin"))</li>
 * <li>OPENING(long) (8 * 3600L * 1000L)</li>
 * <li>CLOSE(long) (22 * 3600L * 1000L)</li>
 * </ul>
 * <b>History:</b><br>
 * - [May 30, 2008] Created (mark)<br>
 * 
 * @author mark
 */
public class ECAGCalendarSettings implements IExchangeCalendarSettings {
	/**
	 * private static final ECAGCalendarSettings eCAGCalendarSettings = new ECAGCalendarSettings();
	 */
	private static final ECAGCalendarSettings eCAGCalendarSettings = new ECAGCalendarSettings();
	/**
	 * private static final Exchange EXCHANGE = Exchange.ECAG;
	 */
	private static final Exchange EXCHANGE = Exchange.ECAG;
	/**
	 * private static final TimeZone TIMEZONE = TimeZone.getTimeZone("Europe/Berlin");
	 */
	private static final TimeZone TIMEZONE = TimeZone.getTimeZone("Europe/Berlin");
	/**
	 * private static final long OPENING = 8 * 3600L * 1000L;<br/>
	 * 08:00 in milliseconds after midnight, TIMEZONE time
	 */
	private static final long OPENING = 8 * 3600L * 1000L;
	/**
	 * private static final long CLOSE = 22 * 3600L * 1000L;<br/>
	 * 22:00 in milliseconds after midnight, TIMEZONE time
	 */
	private static final long CLOSE = 22 * 3600L * 1000L;

	/**
	 * Gets a instance for the ECAG calendar settings.<br/>
	 * returns the associated eCAGCalendarSettings(ECAGCalendarSettings)
	 * @return the instance for the settings.
	 */
	public static synchronized ECAGCalendarSettings getInstance() {
		return eCAGCalendarSettings;
	}
	/**
	 * an empty private ECAGCalendarSettings (implements IExchangeCalendarSettings) constructor
	 */
	private ECAGCalendarSettings() {
		// Instantiation not allowed
	}
	/**
	 * returns the associated TIMEZONE(TimeZone) (TimeZone.getTimeZone("Europe/Berlin"))
	 */
	public TimeZone getTimeZone() {
		return TIMEZONE;
	}
	/**
	 * returns the associated OPENING(long) (8 * 3600L * 1000L)
	 */
	public long getRegularOpeningTime() {
		return OPENING;
	}
	/**
	 * returns the associated CLOSE(long) (22 * 3600L * 1000L)
	 */
	public long getRegularClosingTime() {
		return CLOSE;
	}
	/**
	 * returns the associated EXCHANGE(Exchange) (Exchange.ECAG)
	 */
	public Exchange getExchange() {
		return EXCHANGE;
	}
}
